/*******************************************************************************
 * Copyright (c) 2013 Prometheus Consulting
 *
 *     Licensed under the Apache License, Version 2.0 (the "License"); you may
 *     not use this file except in compliance with the License. You may obtain
 *     a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 *     Unless required by applicable law or agreed to in writing, software
 *     distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *     WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 *     License for the specific language governing permissions and limitations
 *     under the License.
 *******************************************************************************/
/**
 * 
 */
package nz.co.senanque.pizzaorder.catalogue;

import org.springframework.context.MessageSource;
import org.springframework.context.MessageSourceAware;
import org.springframework.context.support.MessageSourceAccessor;

/**
 * @author Roger Parkinson
 *
 */
public class CatalogueItem implements MessageSourceAware {
	
	private String m_name;
	private Class<?> m_type;
	private MessageSourceAccessor m_messageSourceAccessor;

	public Class<?> getType() {
		return m_type;
	}

	public void setType(Class<?> type) {
		m_type = type;
	}

	public CatalogueItem()
	{
		
	}

	public String getName() {
		return m_name;
	}

	public void setName(String name) {
		m_name = name;
	}
	
	public String toString()
	{
		return m_messageSourceAccessor.getMessage(m_name);
	}
	public void setMessageSource(MessageSource messageSource) {
		m_messageSourceAccessor = new MessageSourceAccessor(messageSource);		
	}

}
